package com.yidu.hbatsft.dao;

import com.yidu.hbatsft.domain.AtsAttachment;
import com.yidu.hbatsft.domain.AtsAttachmentCondition;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * ClassName:AtsAttachmentMapper
 * Package:com.yidu.hbatsft.dao
 * Description: 附件功能映射
 *
 * @Date 2019-11-04 10:31
 * @Author 陈熠
 */
@Mapper
public interface AtsAttachmentMapper {

    int deleteByPrimaryKey(Integer attachId);

    int insert(AtsAttachment record);

    /**
     * 新增，根据条件判断新增
     * @param record
     * @return
     */
    int insertSelective(AtsAttachment record);

    AtsAttachment selectByPrimaryKey(Integer attachId);

    /**
     * 根据id修改内容
     * @param record 修改对象
     * @return 修改条数
     */
    int updateByPrimaryKeySelective(AtsAttachment record);

    int updateByPrimaryKey(AtsAttachment record);


    /**
     * 查询所有
     * @param attachmentCondition 辅助功能条件类
     * @return 返回集合对象
     */
    List<AtsAttachment> selectTypeAll(AtsAttachmentCondition attachmentCondition);


    /**
     * 查询首页所需要的信息
     * @param attachmentCondition 用户id，附件类别，分页参数
     * @return 附件信息
     */
    List<AtsAttachment> selectHomePageByUserId(AtsAttachmentCondition attachmentCondition);

    /**
     * 查询总行数
     * @param attachmentCondition 条件类
     * @return 返回总行数
     */
    int selectCount(AtsAttachmentCondition attachmentCondition);

    /**
     * 根据用户id查询所有
     * @param attachmentCondition 用户id
     * @return 附件表。
     */
    List<AtsAttachment> selectByUserId(AtsAttachmentCondition attachmentCondition);

    /**
     * 根据用户id查询所拥有的附件表总数
     * @param attachmentCondition 用户id
     * @return 附件表的总行数
     */
    int selectByUserIdCount(AtsAttachmentCondition attachmentCondition);

    /**
     * 根据附件表类型查询所拥有的附件表
     * @param attachmentCondition 附件表类型，page
     * @return 附件表信息。
     */
    List<AtsAttachment> selectByAttachType(AtsAttachmentCondition attachmentCondition);


    /**
     * 根据附件表类型查询所拥有的附件表的行数
     * @param attachmentCondition 用户id
     * @return 附件表总行数。
     */
    int selectByAttachTypeCount(AtsAttachmentCondition attachmentCondition);


    /**
     * 批量删除加删除
     * @param attachmentCondition 条件类
     * @return 删除行数
     */
    int deleteByAttachId(AtsAttachmentCondition attachmentCondition);

}